package com.example.demo;

import com.example.demo.entity.User;
import com.example.demo.service.UserService;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @author zhouchaoqun
 * @date 2018/11/18 下午7:57
 */
public class Main {
    public static void main(String[] args) {
        ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("classpath:spring.xml");
        UserService userService = context.getBean(UserService.class);
        User user = userService.getById(1);
        System.out.println(user);
        user.setAge(99);
        userService.saveOrUpdate(user);
        User user2 = userService.getById(1);
        System.out.println(user2);
    }
}
